$opts = @{sel = "1"; ip = "8.134.10.226"; port = "22"; user = "root"; tip = "my aliyun server";},
        @{sel = "2"; ip = "192.168.3.15"; port = "22"; user = "cai"; tip = "virtual ubuntu template";},
        @{sel = "3"; ip = "192.168.3.16"; port = "22"; user = "cai"; tip = "virtual ubuntu 1";}

while(1) {
    Write-Output "选项`t    IP    `t主机名"
    foreach ($ele in $opts) {
        Write-Output "[$($ele.sel)]:`t$($ele.ip)`t$($ele.tip)"
    }
    $sel = Read-Host "Do your choice"
    $opt = 0
    foreach ($ele in $opts) {
        if ($ele.sel -eq $sel) {
            $opt = $ele
            break
        }
    }
    if ($opt -ne 0) {
        ssh "$($opt.user)@$($opt.ip)" -p "$($opt.port)"
    } else {
        Write-Output "invalid choice, do it again"
    }
}
